﻿These files replicate the analysis in the paper “Misperceptions of Relative Affluence and Support for International Transfers” that is forthcoming in the Journal of Politics by Gautam Nair.

There are three sets of files. Files with numeric prefixes (“01_”, “06_”, etc.) are code for formatting and analyzing the dataset. Files with the prefix “d_” are datafiles. Running the analysis code will produce files prefixed with “tf_f_” (figures) or “tf_t_” (tables). 

Set the working directory in “01_set_working_directory” and “03_format_dataset” to the folder containing these files on your computer. 

Files 01, 02, 03, and 04 format the dataset. 01 sets the working directory for R. 02 converts the original file from SPSS to Stata format (using R). 03 merges respondent baseline characteristics and responses with question times and zipcode, median incomes, and visits to a separate petition site using Stata. 04 converts this Stata file to R. 

Files 05-23 replicate the tables and figures. You may skip the formatting files and go straight to the analysis using the formatted file “d_r_cleaned_analysis_dataset.Rda”. 

